package com.pda.xinma.utils;

import android.content.Context;

import com.pda.xinma.R;


public class Utils {
    public static String getUnit(int unit) {
        String unitString;
        switch (unit) {
            case 10:
                unitString = "个";
                break;
            case 20:
                unitString = "只";
                break;
            case 30:
                unitString = "支";
                break;
            case 40:
                unitString = "件";
                break;
            case 50:
                unitString = "台";
                break;
            case 60:
                unitString = "根";
                break;
            case 70:
                unitString = "块";
                break;

            case 80:
                unitString = "双";
                break;
            case 90:
                unitString = "把";
                break;
            case 100:
                unitString = "张";
                break;
            case 110:
                unitString = "套";
                break;
            case 120:
                unitString = "卷";
                break;
            case 130:
                unitString = "瓶";
                break;
            case 140:
                unitString = "片";
                break;
            case 150:
                unitString = "副";
                break;
            case 160:
                unitString = "付";
                break;
            case 170:
                unitString = "樘";
                break;

            case 180:
                unitString = "顶";
                break;
            case 190:
                unitString = "辆";
                break;
            case 200:
                unitString = "桶";
                break;
            case 210:
                unitString = "箱";
                break;
            case 220:
                unitString = "袋";
                break;
            case 230:
                unitString = "米";
                break;
            case 240:
                unitString = "升";
                break;
            case 250:
                unitString = "毫升";
                break;
            case 260:
                unitString = "立方米";
                break;
            case 270:
                unitString = "吨";
                break;

            case 280:
                unitString = "千克";
                break;
            case 290:
                unitString = "克";
                break;
            case 300:
                unitString = "纸板箱";
                break;
            case 310:
                unitString = "平方组";
                break;
            default:
                unitString = "其他";
                break;

        }

        return unitString;
    }

    public static String getArticleUnit(Context context,int type){
        String content="";
        switch (type){
            case 10:
                content= context.getResources().getString(R.string.piece);
                break;
            case 20:
                content= context.getResources().getString(R.string.bag);
                break;
            default:
                content= context.getResources().getString(R.string.other);
                break;
        }
        return content;
    }

}
